package chapter4;

/**
 * 求 1+1/2+1/2...1/20
 */
public class Test4_6_3 {
    public static void main(String[] args) {
        double sum = 0;
        double i = 1;
        while (i<=20){
            sum = sum + 1/i;
            i++;
        }
        System.out.println(sum);
    }
}
